$(document).ready(function(){
	$('#main').ligerLayout({leftWidth:176,topHeight:59,space:0,allowLeftResize:false,allowTopResize:false,allowRightCollapse:false});
	var tab = $('#menuTab').ligerTab({changeHeightOnResize:true});
	tab.setContentHeight();
	$(window).resize(function (){
		tab.setContentHeight();
	});
	$("a[pid]").each(function(){
		var p = $(this);
		p.attr('href','javascript:void(0);');
		$(p).bind('click',function(){
			$("ul[children]").each(function(){
				var c = $(this);
				if(c.attr("children") == p.attr('pid')){
					if(c.is(":visible")){
						c.hide();
					}else{
						c.fadeIn("slow");
					}
				}else{
					c.hide();
				}
			});
		});
	});
	$("a[name]").each(function(){
		var a = $(this);
		var url = a.attr('href');
		a.attr('href','javascript:void(0);');
		a.bind('click',function(){
			tab.addTabItem({
				tabid:a.attr('name'),
				url:url,
				text:a.attr('title')
			});
			tab.setContentHeight();
		});
	});
});